
$(function() {
    $(".pitch-on, .allproduct").Jdropdown({
        delay: 2
    }, function(e) {})
});
(function(a) {
    a.fn.Jdropdown = function(d, e) {
        if (!this.length) {
            return
        }
        if (typeof d == "function") {
            e = d;
            d = {}
        }
        var c = a.extend({
            event: "mouseover",
            current: "on",
            delay: 0,
            fun: "default"
        }, d || {});
        var b = (c.event == "mouseover") ? "mouseout" : "mouseleave";
        a.each(this, function() {
            var h = null,
                g = null,
                f = false;
            a(this).bind(c.event, function() {
                if (f) {
                    clearTimeout(g)
                } else {
                    var j = a(this);
                    h = setTimeout(function() {
                        if (c.fun == "default") {
                            j.addClass(c.current).children(".menu-show").show(5);
                            //var _c = j.children(".menu-show");
                            // var _c_height = _c.height();
                            // var _t_height = j.height();
                            // var _c_to_top = j.offset().top - $(window).scrollTop() + _c_height;
                            // var _j_to_top = j.offset().top - $(window).scrollTop() + _t_height;
                            // var _c_to_bottom = $(window).height() - _c_to_top;
                            // var tg_top = _c_to_bottom - 30;
                            // if (_c_to_bottom < 30 && tg_top != (-1) && tg_top != 1) {
                            //     if (($(window).height() - 30) < _j_to_top) {
                            //         var border_height = ($.browser.msie && $.browser.version == "7.0") ? (-2) : 2;
                            //         _c.css("top", "-" + (_c_height - _t_height + border_height) + "px")
                            //     } else {
                            //         _c.css("top", tg_top + "px")
                            //     }
                            // } else {
                            //     _c.css("top", "0px")
                            // }
                        }
                        f = true;
                        if (e) {
                            e(j)
                        }
                    }, c.delay)
                }
            }).bind(b, function() {
                if (f) {
                    var j = a(this);
                    g = setTimeout(function() {
                        if (c.fun == "default") {
                            j.removeClass(c.current).children(".menu-show").hide(5)
                        }
                        f = false
                    }, c.delay)
                } else {
                    clearTimeout(h)
                }
            })
        })
    }
})(jQuery);


